Validated Expression
constructor()
A validated math expression with default equation of "0"
This constructor is primarily intended for validation in other ValidatedFields (such as lists or maps)
This ValidatedField is itself an expression, so you can call eval() or evalSafe() on it directly.
Author
fzzyhmstrs
Since
0.2.0
constructor(defaultValue: String, validVars: Set<Char> = setOf(), validator: EntryValidator<String> = object: EntryValidator<String> {
override fun validateEntry(input: String, type: EntryValidator.ValidationType): ValidationResult<String> {
return Expression.tryTest(input, validVars).wrap(input)
}
override fun toString(): String {
return "Dummy test with valid variable chars"
}
})
Parameters
default Value
String - representation of the desired math expression, parsed to a cached Expression internally.
valid Vars
Set
validator
EntryValidator, optional - validates entered math strings